package com.kmproject.haifu.mvp.ui.adapter;

import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.jess.arms.http.imageloader.ImageLoader;
import com.jess.arms.http.imageloader.glide.ImageConfigImpl;
import com.jess.arms.utils.ArmsUtils;
import com.kmproject.haifu.R;
import com.kmproject.haifu.mvp.model.entity.beans.HouseRentListShowBean;

import java.util.List;

public class HouseRentingShowHeZuImgtemAdapter extends BaseQuickAdapter<HouseRentListShowBean.HouseImageListBean,BaseViewHolder> {
    ImageLoader glideImage;
    public HouseRentingShowHeZuImgtemAdapter(@Nullable List<HouseRentListShowBean.HouseImageListBean> data) {
        super(R.layout.add_img_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, HouseRentListShowBean.HouseImageListBean item) {
        if (glideImage == null) {
            glideImage = ArmsUtils.obtainAppComponentFromContext(mContext).imageLoader();
        }
        helper.<ImageView>getView(R.id.add_img_item_del).setVisibility(View.GONE );

        glideImage.loadImage(mContext, ImageConfigImpl.builder().url(item.getImageUrl()).imageRadius(5)
                .imageView(helper.<ImageView>getView(R.id.add_img_item_img))
                .build());

    }
}
